/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package stream;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

/**
 *
 * @author Educacionit
 */
public class Lector {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        File archivo = new File("entrada.txt");
        FileReader in = null;
        BufferedReader bin = null;

        //System.out.println(archivo.getAbsoluteFile());
        try {
            in = new FileReader(archivo);
            bin = new BufferedReader(in);
            while (bin.ready()){
                char c = (char) bin.read();
                System.out.print(c);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }finally{
            try {bin.close();}
            catch(Exception e){
                e.printStackTrace();
            }
            try {in.close();}
            catch(Exception e){
                e.printStackTrace();
            }
        }
    }

}
